﻿using HCMS.CommonDtos;
using HCMS.Entities.Manage;
using HCMS.Repositories.Manage;
using System.Threading.Tasks;

namespace HCMS.IServices.Manage
{
    /// <summary>
    /// 管理 菜单
    /// </summary>
    public interface IMenuAppService : ICommonAppService<ManageDbContext, Menu>
    {
        /// <summary>
        /// 管理 列表
        /// </summary>
        /// <param name="searchArgs">搜索 参数</param>
        /// <param name="pager">分页 参数</param>
        /// <returns></returns>
        Task<ListPagerDto<Menu>> ManageList(SearchArgsDto searchArgs, PagerArgsDto pager);

        /// <summary>
        /// 菜单 树
        /// </summary>
        /// <param name="status">状态</param>
        /// <returns></returns>
        Task<object> GetAllTree(int status = 9999);

        /// <summary>
        /// 判断菜单是否重复
        /// </summary>
        /// <remarks>
        /// 不允许创建重复的菜单权限
        /// </remarks>
        /// <param name="id">当前的菜单 Id</param>
        /// <param name="controllerName">控制器 名称</param>
        /// <param name="actionName">方法 名称</param>
        /// <returns></returns>
        Task<bool> HasRepeat(int id, string controllerName, string actionName);

    }
}
